# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
pkgname=kiconthemes
pkgver=6.1.0
pkgrel=0
pkgdesc="Support for icon themes"
# armhf blocked by extra-cmake-module
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only"
depends_dev="
	karchive-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	ki18n-dev
	kitemviews-dev
	kwidgetsaddons-dev
	qt6-qtsvg-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt6-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/kiconthemes.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kiconthemes-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	case "$CARCH" in
		s390x) xvfb-run ctest --test-dir build --output-on-failure -E "kicon(engine|loader)_unittest" ;;
		*) xvfb-run ctest --test-dir build --output-on-failure -E "kiconengine_unittest" ;;
	esac
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
a0f0210be8e464518770762f99d072c688872d2b9f324fa12830bdee78c9cf9439514b83ce87a6e526815dd7fbeaa76b6027a0c5cff6119052ccbac8ec8635c2  kiconthemes-6.1.0.tar.xz
"
